﻿using Core.Domain.Users;
using System;
using System.Collections.Generic;
using System.Text;

namespace Core.Domain.Tasks
{
    public class TaskDomainManager
    {
        public void ConfirmBonus(Task task, User user)
        {
            if (user.Bonus >= 50000)
            {
                task.SetBonus(0);
                return;
            }
            if (task.Bonus <= 0)
            {
                task.SetBonus(1000);
            }

            int maxbonus = 50000 - user.Bonus;
            if (maxbonus >= task.Bonus)
                return;
            else
                task.SetBonus(maxbonus);
        }

    }
}
